<!DOCTYPE html>
<html>
<head>
<title>综合年报</title>
<div th:include="base-libs :: base-libs" />
<meta name="content-type" content="text/html; charset=UTF-8">
<style>
body {
	background: #fff;
	overflow: scroll;
	text-align: center;
}
.laydate-icon{
		    line-height: 28px;
		    background-color: #fff;
		    height: 28px;
		    border: 1px solid #B6B6B6;
		    border-radius: 5px;
		    width:84% !important;
		}
.titleTd25{
			width:25%;
		}
</style>
</head>
<script type="text/javascript">
	$(function() {
		$(this).registerManagerPage();
        sfjrYlx();
        initData();
        initView();
	})
	/*数据查询*/
	function initData() {
		var NF = $("#NF").val() || new Date().getFullYear();
		var queryParams = {
			NF : NF
		}
		$.QuickRemote.AjaxJson("queryNbInfo", queryNbInfoHandler, queryParams);
	}

	function sfjrYlx (){
	    $(".SFJRYLT").change(function(){
            yltHideAndShow($(this).val());
		});
	}

	function yltHideAndShow(value){
        if(value == 0){
            $(".yltTr").hide();
            $(".yltInput").val("").removeClass("form-control");
        }else{
            $(".yltTr").show();
            $(".yltInput").addClass("form-control");
        }
	}
	/*数据回调*/
	function queryNbInfoHandler(result) {
        var param = {
            SFTGZYYFW: result['SFTGZYYFW'],
            SFJRYLT: result['SFJRYLT'],
            ZT: result.ZT
        };
        format(param);
		$(".form-control").each(function() {
			var name = $(this).attr('name');
			$(this).val(result[name]);
		})
	}
	function format(param) {
		$.each(param,function(key,value){
			if(value){
				$("."+key+value).prop("checked", 'true');
				if(key == "SFJRYLT"){
                    yltHideAndShow(value);
                }
			}else{
				//默认选择是
				$("."+key+'1').prop("checked", 'true');
                if(key == "SFJRYLT"){
                    yltHideAndShow("1");
                }
			}
		})
		var zt = param.ZT;
		var shztObj = {'0':'暂存','1':'待审核','2':'审核不通过','3':'审核通过'};
		$("#SHZT").val(shztObj[zt] || '未填报');
		if (zt == '1' || zt == '3') {
			$("input:not('#NF')").attr("disabled","disabled");
			$("#south").hide();
		} else{
			$("#south").show();
            $("input:not('#NF')").removeAttr("disabled");
		}
		 $('body').layout("resize");
	}
	function initView() {
		$("#btnTJ").click(function() {
			if ($(".form-control").QuickValidate()) {
				$.QuickRemote.AjaxFiledFormSubmit("queryForm",function(result) {
					var info = result["info"];
					if (result["state"]) {
						$.QuickAlert.alertNormal("保存成功！", {callback : function() {
                            	initData()
							}
						});
					} else {
						$.QuickAlert.alertFail({content : info["faultInfo"]});
					}
				}, {ZT: 1});
			}
		})
		
		//审核记录
		$("body").on('click','#btnShjl',function(){
			StoreCache.setCache("BBID", $("#ID").val());
			parent.layer.open({
				  type: 2,
				  area: ["60%", "500px"],
				  content: contextRoot + 'wsj/bbShjl.html',
				  scrollbar: false,
				  resize: false,
				  title:'审核记录'
			});
		});
	}

	function queryByNf() {
		$("#NF").val($dp.cal.newdate.y);
		initData();
	}

</script>
<body class="easyui-layout">
	<form id="queryForm" action="save">
		<input class="form-control" type="hidden" id="ID" name="ID" /> 
		<input class="form-control" type="hidden" id="YLJGID" name="YLJGID" /> 
		<input class="form-control" type="hidden" id="JGLB" name="JGLB" /> 
		<input class="form-control" type="hidden" id="XZQH" name="XZQH" />
		
		<div region="north" style="height:60px;border:0;border-bottom:1px solid #ddd">
		<table class="form-table">
			<tr>
				<td class="td-text">审核状态：</td>
				<td class="td-content">
					<input id="SHZT" name="SHZT" readonly="readonly">
				</td>
				<td class="td-text">机构名称：</td>
				<td class="td-content">
					<input id="JGMC" name="JGMC" class="form-control dataField" readonly="readonly">
				</td>
				<td class="td-text"><label>年份：</label></td>
				<td class="td-content">
					<input type="text" id="NF" name="NF" class="form-control laydate-icon"
					onfocus="WdatePicker({dateFmt:'yyyy',readOnly:true,onpicking:queryByNf})"
					quick-config="label:'年份', validateProxy:'notNull length', length: '10'" />
				</td>
				<td>
					<button id="btnShjl" class="btn btn-info" type="button">审核记录</button>
				</td>
			</tr>
		</table>
		</div>
		<div region="center" border="false">
		<table class="form-table">

			<tr>
				<td class="td-text titleTd25"><label>1.医生总数：</label></td>
				<td class="td-content">
					<input id="YSZS" name="YSZS" class="form-control "
					quick-config="label:'医生总数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text titleTd25"><label>2.护士总数：</label></td>
				<td class="td-content">
					<input id="HSZS" name="HSZS" class="form-control"
					quick-config="label:'护士总数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
			<tr>
				<td class="td-text"><label>3.多点执业医师数：</label></td>
				<td class="td-content">
					<input id="DDZYYSS" name="DDZYYSS" class="form-control"
					quick-config="label:'多点执业医师数', validateProxy:'notNull length num', length: '10'" />
				</td>
				<td class="td-text">4.是否提供中医药服务：</td>
				<td class="td-content">
					<input style="width:18px;float:left" type="radio"
					name="SFTGZYYFW" value="1" class="SFTGZYYFW SFTGZYYFW1">
					<span style="float:left;margin-right:15px">是</span>
					
					<input style="width:18px;float:left" type="radio" 
					name="SFTGZYYFW" value="0" class="SFTGZYYFW SFTGZYYFW0">
					<span style="float:left">否</span>
				</td>
			</tr>
			<tr>
				<td class="td-text">5.是否加入医联体：</td>
				<td class="td-content" colspan="3">
					<input style="width:18px;float:left" type="radio"
					name="SFJRYLT" value="1" class="SFJRYLT SFJRYLT1">
					<span style="float:left;margin-right:15px">是</span>
					
					</input><input style="width:18px;float:left" type="radio" 
					name="SFJRYLT" value="0" class="SFJRYLT SFJRYLT0">
					<span style="float:left">否</span>
				</td>
			</tr>
			<tr class="yltTr">
				<td class="td-text"><label>6.医联体名称：</label></td>
				<td class="td-content">
					<input id="YLTMC" name="YLTMC" class="form-control yltInput"
						   quick-config="label:'医联体名称', validateProxy:'notNull length', length: '100'" />
				</td>
				<td class="td-text"><label>7.医联体主导机构：</label></td>
				<td class="td-content">
					<input id="YLTZDJG" name="YLTZDJG" class="form-control yltInput"
					quick-config="label:'医联体主导机构', validateProxy:'notNull length', length: '64'" />
				</td>
			</tr>
			<tr class="yltTr">
				<td class="td-text"><label>8.加入医联体机构数：</label></td>
				<td class="td-content">
					<input id="JRYLTJGS" name="JRYLTJGS" class="form-control yltInput"
						   quick-config="label:'加入医联体机构数', validateProxy:'notNull length num', length: '10'" />
				</td>
			</tr>
		</table>
		</div>
	</form>
	<div region="south" id="south" style="height:45px;line-height:40px;text-align:center;border:0;border-top:1px solid #ddd">
		<div style=" margin:0 auto">
			<button id="btnTJ" class="btn btn-info" type="button">提交</button>
		</div>
	</div>

</body>
</html>
